package observer.observer1;


import java.util.Observable;
import java.util.Observer;

public class GuMing implements Observer {
    private String name;

    public GuMing(String name) {
        this.name = name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void update(Observable o, Object arg) {
       if (name.equals("Tom")){
           return;
       }
       double price=(double)arg;
       System.out.println(name+"收到股票价格："+price);
    }
}
